﻿// JScript 文件

 //var  m_tagbox="tag_box";
// function iFrameHeight_detail() 
//    { 
//        var ifm= document.getElementById("survey_frame_detail"); 
//        var subWeb = document.frames ? document.frames["survey_frame_detail"].document : ifm.contentDocument; 
//        if(ifm != null && subWeb != null) 
//        { 
//           //alert(subWeb.body.scrollHeight); 
//             ifm.height = subWeb.body.scrollHeight+"px"; 
//            //document.getElementById("survey_frame_detail").height=subWeb.body.scrollHeight+"px";
//            //alert(document.getElementById("survey_frame_detail").height);
//           } 
//    }

function text_focus()
    {
   
      if(jQuery("#cancelReasonText").get(0).value=="70字以内") 
      {
        jQuery("#cancelReasonText").get(0).value="";
      } 
   }
function checkLength()
{
   var s=jQuery("#cancelReasonText").val();
   setTimeout(function(){
       if(s.length>=70) 
       {
           jQuery("#cancelReasonText").val(s.substr(0,70));
           return false;
       }
       },10);
} 
//增加取消时修改支付方式
function cancel_updatePay(id,orderId,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus,presaleType)
{
    var sbu = new StringBuilder();
    sbu.append('<div class="myddorder_popup_wrap myddorder_popup_cancel">');
    sbu.append('<div class="myddorder_popup"><div class="myddorder_popup_title">');
    sbu.append('<h2>取消订单</h2><a href="javascript:hidden()" class="close" title="关闭">关闭</a></div>');
    sbu.append('<div class="myddorder_popup_main">');
    sbu.append('<p class="tips_cal_re"><label><input type="radio" name="update" id="updatePaymentMethodType">网上支付改为货到付款-现金</label><p>');
    sbu.append('<p class="tips_cal_re"><label><input type="radio" name="update" id="cancelInsist">残忍取消订单</label><p>');
    sbu.append('<div class="myddorder_popup_btn"><button onClick=javascritpt:update_pay("',id,'","',orderId,'","',ifcouponpay,'","',is_product_shippingfee,'","',IsContractMachine,'","',shopId,'","',orderStatus,'","',custId,'","',jitSupplierId,'","',moveStoreStatus,'");>确 定</button><button class="btn2" onClick="javascript:hidden_for_cancel_detail();">取消</button></div>');
    sbu.append('</div></div></div>');
    var lin =  jQuery(m_tagbox).get(0);
    lin.innerHTML=sbu.getString();
    var pos = jQuery("#"+id).offset();    
    lin.style.left= pos.left - 250  + "px";
    lin.style.top = pos.top + "px";			
    lin.style.display="block";
}
function update_pay(id,orderId,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus)
{
 //选择“网上支付改为货到付款-现金”--调用api修改支付方式
 if(jQuery("#updatePaymentMethodType").get(0).checked)
 {
 //调用生成申请单api
    var outputDataUrl = "./outputData.aspx";
    var myurl = outputDataUrl;  
    jQuery.get(myurl,{modify:"true",Dtype:"updatePay",Id:orderId,d:new Date()},
         function(data)
            {
               if(data!="0")
               {
                 jQuery("#detail_cancelorder1").get(0).style.display="none";
                 var lin =  jQuery(m_tagbox).get(0);   
                 jQuery(lin).html(detailApplycancelJS("修改失败，请您稍后再试")); 
                 lin.style.display="block";   
               } 
               hidden_for_cancel_detail();
               refreshBen();
            }
         );
 }
 //选择“残忍取消订单” --调用取消订单js：detail_orderswin直接取消
 else if(jQuery("#cancelInsist").get(0).checked)
 {
    detail_orderswin(id,orderId,orderId,0,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus,presaleType); 	  
 }
}
//取消订单1
function detail_orderswin(Id,parent_id,orderid,canceltype,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus,presaleType)
{
       
    var lin =  jQuery(m_tagbox).get(0);
    if(!lin)return;
    lin.innerHTML = detail_cancelOrderJS(parent_id,orderid,canceltype,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus,presaleType);  
 
    var pos = jQuery("#"+Id).offset();    

   // new dragObject(lin, "handle", null, null, null, null, null, false);
     
    lin.style.left= pos.left - 250  + "px";
    lin.style.top = pos.top + "px";			
    lin.style.display="block";	  

}

//取消订单2 20110402是否显示添加购物车 is_product_shippingfee
function detail_cancelOrderJS(parent_id,orderid,canceltype,ifcouponpay,is_product_shippingfee,IsContractMachine,shopId,orderStatus,custId,jitSupplierId,moveStoreStatus,presaleType)
{
        //cancelType   0:订单只有一个包裹，取消订单；1：订单有两个包裹，全部取消；2：订单有两个包裹，取消其中一个 就都取消了。
        
  var sb = new StringBuilder();
       //商家订单审核后的取消
    
if(shopId>0 && orderStatus>=100)
{
    sb.append('<div class="myddorder_popup_wrap myddorder_popup_cancel">');
    sb.append('<div class="myddorder_popup status4">');
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();" class="close" title="关闭">关闭</a></div>');
    sb.append('<div class="myddorder_popup_main">');
    if(presaleType==1||presaleType==2)
    {   
        sb.append('<h3 class="icon_success status3"><span>取消订单，定金不退，订单取消申请</span></h3>');
    }
    else
    {
        sb.append('<h3 class="icon_success status3"><span>订单取消申请</span></h3>');
    }
    sb.append('<div class="myddorder_popup_form">');
    sb.append('<p class="form_survey"><font color="red">*</font>取消原因(必填)：</p>');
    sb.append(' <p class="form_survey4"><input name="cancelReason" type="radio" value="修改支付方式" class="checkbox" /><label>修改支付方式</label><input name="cancelReason" type="radio" value="添加删除商品" class="checkbox" /><label>添加删除商品</label><input name="cancelReason" type="radio" value="修改收货地址" class="checkbox" /><label style="width:76px">修改收货地址</label></p>');
    sb.append('<p class="form_survey4"><input name="cancelReason" type="radio" value="商品价格太高" class="checkbox" /><label>商品价格太高</label><input name="cancelReason" type="radio" value="买多或买错了" class="checkbox" /><label>买多或买错了</label><input name="cancelReason" type="radio" value="送货时间太长" class="checkbox" /><label style="width:76px">送货时间太长</label></p>');
    sb.append('<p class="form_survey4"><input name="cancelReason" type="radio" value="现在不想购买" class="checkbox" /><label>现在不想购买</label><input name="cancelReason" type="radio" value="重新下单" class="checkbox" /><label>重新下单</label><input name="cancelReason" type="radio" value="运费太高" class="checkbox" /><label style="width:76px">运费太高</label></p>');
	sb.append('<p class="form_survey4"><input name="cancelReason" type="radio" value="别处价格更低" class="checkbox" /><label>别处价格更低</label><input name="cancelReason" type="radio" value="其它" class="checkbox" /><label>其它</label></p>');  
    sb.append('<p class="form_survey4"><textarea id="cancelReasonText" onfocus="javascritpt:text_focus()" name="textarea" class="case_textarea" maxlength="70" onchange="checkLength()" onkeyup ="checkLength()">70字以内</textarea></p>'); 
    sb.append('<div class="clear"></div>'); 
    sb.append('<p class="hint">温馨提示：订单取消成功后无法恢复</p>');
    sb.append('<div id="cancelReason" style="display:none"><p class="clear"></p><p class="hint">请选择取消原因</p></div>');
    sb.append('</div>');
    sb.append('<div class="myddorder_popup_btn"><button style="margin-right:50px" onClick=javascritpt:shopCancel("',orderid,'","',shopId,'","',custId,'");>确定取消</button><button onClick="javascript:hidden_for_cancel_detail();">暂不取消</button></div>');   
    sb.append('</div></div>'); 
    return sb.getString();
}
if(canceltype == '0')//非分包裹订单取消
{
sb.append('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');
sb.append('<div id="handle" class="myddorder_popup">');
sb.append('<div class="myddorder_popup_title"><h2>取消订单</h2><a href="javascript:hidden();" class="close" title="关闭">关闭</a></div>');
        if(ifcouponpay==0)
        {       
           
            sb.append('<div class="myddorder_popup_main">');
            if(presaleType==1||presaleType==2)
            {            
                sb.append('<h3 class="icon_warning status1"><i></i><span>取消订单，定金不退，您确定取消订单？</span></h3>');
            }
            else
            {
                sb.append('<h3 class="icon_warning status1"><i></i><span>您确定取消订单？</span></h3>');
            }   
            if(is_product_shippingfee!=1 && IsContractMachine !=1)
            {
             sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>');  
            }        
            
            
            //if(jQuery("#ifaddcart").get(0).checked=="checked")
            
              sb.append('<div class="myddorder_popup_btn"><button name="confirm"  id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  
           
            sb.append('</div> ');     
       
        }
        else
        {            
            sb.append('<div class="myddorder_popup_main">');
            if(presaleType==1||presaleType==2)
            {              
                sb.append('<h3 class="icon_warning status1"><i></i><span>取消订单，定金不退，您确定取消订单？</span></h3>');   
            }
            else
            {
                sb.append('<h3 class="icon_warning status1"><i></i><span>您确定取消订单？</span></h3>');
            }
            
             //sb.append('<p class="tips">温馨提示：您的订单中使用了礼券，取消订单后礼券将在10分钟左右退回您的账户！</p>');    
              if(is_product_shippingfee!=1 && IsContractMachine !=1)
              {
              sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>'); 
              }       
             
            
            sb.append('<div class="myddorder_popup_btn"><button  name="confirm"   id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  

            
            sb.append('</div> ');     
        }
   
}
else if(canceltype == '1')
{
sb.append('<div class="myddorder_popup_wrap myddorder_popup_cancel myddorder_popup_cancel2">');
sb.append('<div class="myddorder_popup">');
sb.append('<div class="myddorder_popup_title"><h2>取消订单</h2><a href="javascript:hidden();" class="close" title="关闭">关闭</a></div>');
      if(ifcouponpay==0)
        {       
           
            sb.append('<div class="myddorder_popup_main">');
            if(presaleType==1||presaleType==2)
            {                  
                sb.append('<h3 class="icon_warning status6"><i></i><span>取消订单，定金不退，请确认是否要取消订单，该操作需要经过审核，请您耐心等待。</span></h3>');         
            }
            else
            {
                sb.append('<h3 class="icon_warning status6"><i></i><span>请确认是否要取消订单，该操作需要经过审核，请您耐心等待。</span></h3>'); 
            }
            sb.append('<p class="tips">温馨提示：1、已配货的订单不能取消；2、请您稍后在“我的订单”列表中查看订单是否取消成功。</p>');      
            
            if(is_product_shippingfee!=1 && IsContractMachine !=1)
            {
             sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>');  
            }       
           
           
              sb.append('<div class="myddorder_popup_btn"><button  name="confirm"   id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  

            
            sb.append('</div> ');     
       
        }
        else
        {            
            sb.append('<div class="myddorder_popup_main">'); 
            if(presaleType==1||presaleType==2)
            {            
                sb.append('<h3 class="icon_warning status6"><i></i><span>取消订单，定金不退，请确认是否要取消订单，该操作需要经过审核，请您耐心等待。</span></h3>');         
            }
            else
            {
                sb.append('<h3 class="icon_warning status6"><i></i><span>请确认是否要取消订单，该操作需要经过审核，请您耐心等待。</span></h3>');
            }
            sb.append('<p class="tips">温馨提示：1、已配货的订单不能取消；2、请您稍后在“我的订单”列表中查看订单是否取消成功。</p>');      
                 
            //sb.append('<p class="tips">温馨提示：您的订单中使用了礼券，取消订单后礼券将在10分钟左右退回您的账户！</p>');    
            if(is_product_shippingfee!=1 && IsContractMachine !=1)
            {
            sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>'); 
            }        
             
           
              sb.append('<div class="myddorder_popup_btn"><button  name="confirm"   id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  

          
            sb.append('</div> ');     
        }
}
else 
{
sb.append('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');
sb.append('<div id="handle" class="myddorder_popup">');
sb.append('<div class="myddorder_popup_title"><h2>取消订单</h2><a href="javascript:hidden();" class="close" title="关闭">关闭</a></div>');
        if(ifcouponpay==0)
        {       
           
            sb.append('<div class="myddorder_popup_main">'); 
            if(presaleType==1||presaleType==2)
            {               
                sb.append('<h3 class="icon_warning status1"><i></i><span>取消订单，定金不退，您确定取消订单？</span></h3>');  
            }
            else
            {
                sb.append('<h3 class="icon_warning status1"><i></i><span>您确定取消订单？</span></h3>');
            }
            
            sb.append('<p class="tips">温馨提示：您的订单是分包裹发送订单，取消订单后所有包裹都将取消。</p>');   
             if(is_product_shippingfee!=1 && IsContractMachine !=1)  
             {
             sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>');  
             }      
            
            
              sb.append('<div class="myddorder_popup_btn"><button  name="confirm"  id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  

          
            sb.append('</div> ');     
       
        }
        else
        {            
            sb.append('<div class="myddorder_popup_main">'); 
            if(presaleType==1||presaleType==2)
            {              
                sb.append('<h3 class="icon_warning status1"><i></i><span>取消订单，定金不退，您确定取消订单 ',orderid,'？</span></h3>');   
            }
            else
            {
                sb.append('<h3 class="icon_warning status1"><i></i><span>您确定取消订单 ',orderid,'？</span></h3>');
            }
            
             sb.append('<p class="tips">温馨提示：您的订单是分包裹发送订单，取消订单后所有包裹都将取消。</p>');  
            
             //sb.append('<p class="tips">温馨提示：您的订单中使用了礼券，取消订单后礼券将在10分钟左右退回您的账户！</p>');    
             if(is_product_shippingfee!=1 && IsContractMachine !=1)
             {
               sb.append('<p class="goods_opration"><input type="checkbox" id="ifaddcart" /><label class="goods_opration_text">将订单中的商品重新放入购物车</label></p>');  
             }        
           
            
              
              sb.append('<div class="myddorder_popup_btn"><button  name="confirm"  id="btn_OrderCancel" onClick=javascritpt:detail_postCancelDate("',orderid,'","',canceltype,'","',jitSupplierId,'","',moveStoreStatus,'","',shopId,'","',orderStatus,'");>确 定</button><button  name="cancel"  class="btn2"  onclick="javascript:hidden_for_cancel_detail();" >关 闭</button></div>');  

           
            sb.append('</div> ');     
        }

}
   sb.append('<\/div>');

    return sb.getString();


}
//商家取消
function shopCancel(orderId,shopId,custId)
{
    var cancelReason=jQuery(":radio[name='cancelReason']:checked").val();
    if(jQuery("#cancelReasonText").get(0).value!="" && jQuery("#cancelReasonText").get(0).value!="70字以内")
    {
        cancelReason+=","+jQuery("#cancelReasonText").get(0).value;
    }
    if(cancelReason=="" || cancelReason==undefined ||(cancelReason=="其它" &&(jQuery("#cancelReasonText").get(0).value==""||jQuery("#cancelReasonText").get(0).value=="70字以内")))
    {
       jQuery("#cancelReason").get(0).style.display="block";
       return ;
    }
    //调用生成申请单api
    var outputDataUrl = "./outputData.aspx";
    var myurl = outputDataUrl;  
    jQuery.post(myurl,{modify:"true",Dtype:"shopCancelOrder",Id:orderId,d:new Date(),cancelReason:encodeURI(cancelReason),custId:custId,shopId:shopId},
         function(data)
            {
               if(data!="0")
               {
                  hidden_for_cancel_detail();  
                 //refreshBen();
                  //7有申请单进行中8顾客已经提交过一次申请单
                  if( data =="8")
                  {
                     jQuery("#detail_cancelorder1").get(0).style.display="none";
                     var lin =  jQuery(m_tagbox).get(0);   
                     jQuery(lin).html(detailApplycancelJS("您已提交过取消申请单")); 
                     lin.style.display="block";   
                  } 
                  if(data=="7")
                  {
                     jQuery("#detail_cancelorder1").get(0).style.display="none";
                     var lin =  jQuery(m_tagbox).get(0); 
                     jQuery(lin).html(detailApplycancelJS("已有申请单处理中"));			 
                     lin.style.display="block";
                     
                  }
                   
               }
               else if(data=="0")
               {
                  hidden_for_cancel_detail();  
                  refreshBen();
               }
                  
            }
         );
  }
  function detailApplycancelJS(text)
{     
    
    var sb = new StringBuilder('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');    
     sb.append('<div id="handle"  class="myddorder_popup">');
     
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();refreshBen();" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    
    sb.append('<div class="myddorder_popup_main">');
    sb.append('<h3 class="icon_none"><span>').append(text).append('</span></h3>');  
    sb.append('<div class="myddorder_popup_btn"><button onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口</button></div>');
    sb.append('<\/div>');
   
     sb.append('<\/div>');
     sb.append('<\/div>');

    return sb.getString();
    
    
}

//取消订单3
function detail_postCancelDate(orderid,canceltype,jitSupplierId,moveStoreStatus,shopId,orderStatus)
{  

     if(jQuery("#ifaddcart").get(0)!=undefined)
         {
           if(jQuery("#ifaddcart").get(0).checked)
           {     
            cancel_to_addshopcart(orderid);
           }   
         } 
    var outputDataUrl = "./outputData.aspx";
   
    var myurl = outputDataUrl;  
     jQuery.get(myurl,{modify:"true",Dtype:"cancelorder",Id:orderid,d:new Date(),from:"detail",CancelType:canceltype,JitSupplierId:jitSupplierId,MoveStoreStatus:moveStoreStatus,ShopId:shopId,OrderStatus:orderStatus},
         function(data)
            {
               var tex =data;	   
                 var lin =  jQuery(m_tagbox).get(0);
                          
                if(tex == "") 
                {
                    return;
                } 
                else if(tex.indexOf("Can't cancel!")>=0)
                {
                    // 您的订单已经在印刷中，订单不可取消。
                    jQuery(lin).html(jitCanNotCancel()); 
                      
                    lin.style.display="block";
                } 
                else if(tex.indexOf("Cancel unsuccessful!")>=0)
                {
                
                    jQuery(lin).html(cancelUnsuccessful()); 
                      
                    lin.style.display="block";
                }
                else if(tex.indexOf("http")>=0)
                {
                    //问卷调查显示
                    hidden();
                    //lin.innerHTML = surveyWindow_for_cancelorder(tex); 
                    jQuery(lin).html(detail_surveyWindow_for_cancelorder(tex)); 
                    
                    
                    new dragObject(lin, "handle", null, null, null, null, null, false);             


                    lin.style.display="block";     
                    
                    windowMoveToCenterfororderlistsurvey();
                    
                }  
                else if(tex.indexOf("ok")>=0)
                {
                    jQuery(lin).html(cancelSuccJSDetailNew(tex)); 
                    new dragObject(lin, "handle", null, null, null, null, null, false);  
                    lin.style.display="block";    
                }
               else
               {
                        var text="订单取消成功！";     
                       
                        jQuery(lin).html(detail_cancelSuccJS(text)); 
                 

                         lin.style.display="block";    
               }   
            }
         );

}

//订单取消后成功页    //取消订单5
function  detail_surveyWindow_for_cancelorder(survey_url)    
{
    var sb = new StringBuilder('<div id="e1" style="width:auto;">');     
     sb.append('<div id="handle">');
     sb.append('<\/div>');    
     sb.append('<iframe onLoad="iFrameHeight_detail()"    src="',survey_url,'" style="width:830px;" frameborder="0" scrolling="no"   name="survey_frame_detail" id="survey_frame_detail" ></iframe>');
     sb.append('<\/div>'); 
    return sb.getString();
}
    function iFrameHeight_detail() 
    { 
        var ifm= document.getElementById("survey_frame_detail"); 
        var subWeb = document.frames ? document.frames["survey_frame_detail"].document : ifm.contentDocument; 
        if(ifm != null && subWeb != null) 
        { 
          ifm.height = subWeb.body.scrollHeight+"px"; 
        } 
    }

// JIT不能取消弹窗    
function jitCanNotCancel()
{       

    var sb = new StringBuilder('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');    
     sb.append('<div id="handle"  class="myddorder_popup">');
     
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();refreshBen();" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    
    sb.append('<div class="myddorder_popup_main">');
    sb.append('<h3 class="icon_warning"><span>您的订单已在印刷中，不可以取消，感谢您的支持。</span></h3>');  
    sb.append('<div class="myddorder_popup_btn"><button onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口</button></div>');
    sb.append('<\/div>');
   


    return sb.getString();
    
    
}

// "订单未取消成功，商品到货后您可选择不签收"    
function cancelUnsuccessful()
{       

    var sb = new StringBuilder('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');    
     sb.append('<div id="handle"  class="myddorder_popup">');
     
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();refreshBen();" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    
    sb.append('<div class="myddorder_popup_main">');
    sb.append('<h3 class="icon_warning"><span>订单未取消成功，商品到货后您可选择不签收</span></h3>');  
    sb.append('<div class="myddorder_popup_btn"><button onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口</button></div>');
    sb.append('<\/div>');
   


    return sb.getString();
    
    
}


///2012.11.21 取消成功弹窗
function cancelSuccJSDetailNew(text)
{     
    //var refund_text = text.split("|"); //字符分割     
    var sb = new StringBuilder();    
    sb.append('<div class="myddorder_feedback myddorder_tuikuan">');
    sb.append('<div class="myddorder_feedback_title" id="handle">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();refreshBen();" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    sb.append('<div class="myddorder_feedback_main">');
    sb.append('<h3 class="icon_success"><i></i><span>取消订单成功！</span></h3>');
//    if(refund_text.length > 1)
//    {
//        sb.append('<div class="order_tuikuan">');
//        sb.append('<p class="title">退款说明：</p>');
//        for (i=1;i<refund_text.length ;i++ )   
//        {   
//            //document.write(refund_text[i]+"<br/>");    //分割后的字符输出
//            sb.append('<p>'+refund_text[i]+'</p>');
//        } 
//        //<p>您采用银行转账支付的<b class="red">10000.00</b>元，会于<span class="red">1个工作日</span>退回当当 账户余额</p>
//        sb.append('</div>');
//    }
    
    sb.append('<div class="myddorder_popup_btn"><button onclick="javascript:hidden_for_cancel();refreshBen();">关闭窗口</button></div>');
    sb.append('</div>');
    return sb.getString();
}

///取消订单 成功后的方法
function detail_cancelSuccJS(text)
{     
    
    var sb = new StringBuilder('<div id="e1" class="myddorder_popup_wrap myddorder_popup_cancel">');    
     sb.append('<div id="handle"  class="myddorder_popup">');
     
    sb.append('<div class="myddorder_popup_title">');
    sb.append('<h2>取消订单</h2><a href="javascript:hidden();refreshBen();" class="close" title="关闭">关闭</a>');
    sb.append('</div>');
    
    sb.append('<div class="myddorder_popup_main">');
    sb.append('<h3 class="icon_none"><span>谢谢反馈！</span></h3>');  
    sb.append('<div class="myddorder_popup_btn"><button onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口</button></div>');
    sb.append('<\/div>');
   
     sb.append('<\/div>');
     sb.append('<\/div>');

    return sb.getString();
    
    
}

//
function refreshBen()
{
   window.location.reload();

}



/////////////////////////////////////////////////////////////////////////////////////////确认等待部分
//20101207 

function showWaitingDialog_detail(Id,orderid,param,parent_id)
{
 var lin =  jQuery(m_tagbox).get(0);
    if(!lin)return;
    lin.innerHTML = WaitingDialogContent_detail(orderid,param,parent_id);

    
    var pos = jQuery("#"+Id).offset();    

    new dragObject(lin, "handle", null, null, null, null, null, false);
     
    lin.style.left= pos.left - 30  + "px";
    lin.style.top = pos.top +65 + "px";			
    lin.style.display="block";	    
}

function  WaitingDialogContent_detail(orderid,param,parent_id)
{
   var sb = new StringBuilder(' <div  id="e1"  class="ddnew_window window_surveyok window_waiting">');
   // sb.append(' <div  id="handle" class="">');
    sb.append('<h2   id="handle" ><span>订单',parent_id,'<\/span><a href="javascript:hidden();" class="w_close" title="关闭">关闭<\/a><\/h2>');
    //sb.append(' <\/div>');    
       sb.append('<div class="window_content">');
          sb.append('<p>您确认等待么？<\/p>');
             sb.append('<p class="split_ok" ><button onClick=javascritpt:truePostWaitData_detail("',orderid,'","',param,'","',parent_id,'");>确 定<\/button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn2" onclick="javascript:hidden_for_cancel_detail();">取 消<\/button><\/p>');             
             
               sb.append('<\/div>'); 
                sb.append('<\/div>');   

        return sb.getString();   

}

function truePostWaitData_detail(orderid,param,parent_id)
{
    
    
     var outputDataUrl = "./outputData.aspx";       
        
        var myurl = outputDataUrl;        	 
        
        comparameters =  param;    
      
         //jquery
         
         jQuery.get(myurl,{modify:"true",Dtype:"confirmwaitorder",Id:orderid,d:new Date(),from:"list"},
             function(data)
                        {
                                       var tex =data;	   
                                      
                                         var lin =  jQuery(m_tagbox).get(0);
                                                  
                                        if(tex == "") 
                                        {
                                           return;
                                        }    
                                        else if(tex=="ok")
                                        { 
                                             jQuery(lin).html(afterPostWait_detail(parent_id,tex));           
                                         
                                            lin.style.display="block";                                                 
                                          
                                       }
                                       else
                                       {
                                            var text="确认等待失败！";     
                                             jQuery(lin).html(afterPostWait_detail(parent_id,"error"));                                         
                                           
                                            lin.style.display="block";    
                                       }   
                        }
             );
         
     //jquery

   
   
}

function afterPostWait_detail(orderid,tex)
{
  if(tex=="ok")
  {
      var sb = new StringBuilder(' <div   id="e1"  class="ddnew_window window_surveyok window_waiting">');
      
        sb.append('<h2   id="handle"><span>订单',orderid,'<\/span><a href="javascript:hidden();refreshBen();" class="w_close">关闭窗口<\/a><\/h2>');
       
       sb.append('	<div class="window_content">');
          sb.append(' <p>您已经确认等待<\/p>');
             sb.append('<p class="split_ok" ><button  onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口<\/button><\/p>');  
               sb.append('<\/div>'); 
                sb.append('<\/div>');   
        return sb.getString();    
 
  }
  else
  {
          var sb = new StringBuilder(' <div   id="e1"  class="ddnew_window window_surveyok window_waiting">');
    
        sb.append('<h2   id="handle"><span>订单',orderid,'<\/span><a href="javascript:hidden();refreshBen();" class="w_close">关闭窗口<\/a><\/h2>');
          
       sb.append('	<div class="window_content">');
          sb.append(' <p>确认等待失败，请重新尝试！<\/p>');
             sb.append('<p class="split_ok" ><button  onclick="javascript:hidden_for_cancel_detail();refreshBen();">关闭窗口<\/button><\/p>');  
               sb.append('<\/div>'); 
                sb.append('<\/div>');   
        return sb.getString();    
        
  }
  
}

function hidden_for_cancel_detail()
{  
    var lin = document.getElementById("tag_box");
    if(lin)lin.style.display="none";
}



